<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$plugin_name = $_RQ['basicname'] ? $_RQ['basicname'] : '';
if($_RQ['op']=='get'){
	//显示统计数据
		$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
		$mounthtime =  mktime(0,0,0,date('m'),1,date('Y'));
		$itemsum=array();
		//今日帖子
		$itemsum['item0_day']=pdo_count('jy_wuliu_item',array('uniacid'=>$_SESSION['uniacid'],'type'=>0,'createtime >'=>$daytime));
		$itemsum['item1_day']=pdo_count('jy_wuliu_item',array('uniacid'=>$_SESSION['uniacid'],'type'=>1,'createtime >'=>$daytime));
		$itemsum['item_day']=pdo_count('jy_wuliu_item',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>$daytime));
		//总帖子
		$itemsum['item0_all']=pdo_count('jy_wuliu_item',array('uniacid'=>$_SESSION['uniacid'],'type'=>0));
		$itemsum['item1_all']=pdo_count('jy_wuliu_item',array('uniacid'=>$_SESSION['uniacid'],'type'=>1));
		$itemsum['item_all']=pdo_count('jy_wuliu_item',array('uniacid'=>$_SESSION['uniacid']));
		
		//总拼车
		$itemsum['jili0_all']=pdo_count('jy_wuliu_item_jieli',array('uniacid'=>$_SESSION['uniacid'],'type'=>0));
		$itemsum['jili1_all']=pdo_count('jy_wuliu_item_jieli',array('uniacid'=>$_SESSION['uniacid'],'type'=>1));
		$itemsum['jili_all']=pdo_count('jy_wuliu_item_jieli',array('uniacid'=>$_SESSION['uniacid']));
		$itemsum['jili_day']=pdo_count('jy_wuliu_item_jieli',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>$daytime));
		$htmls=array(
				array('type'=>'data','tpltype'=>1,'one_num'=>5,'title'=>'应用今日/总帖子数据指标','datas'=>array(
					array('title'=>'找车帖子','num'=>2,'data'=>array($itemsum['item0_day'],$itemsum['item0_all'])),
					array('title'=>'供车帖子','num'=>2,'data'=>array($itemsum['item1_day'],$itemsum['item1_all'])),
				)),
				array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'wechat','title'=>'帖子数据指标','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>array(
						array('name'=>'找车帖子','value'=>$itemsum['item0_all']),
						array('name'=>'供车帖子','value'=>$itemsum['item1_all']),
					),
				)),
				array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'wxapp','title'=>'拼车数据指标','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>array(
						array('name'=>'找车拼车','value'=>$itemsum['jili0_all']),
						array('name'=>'供车拼车','value'=>$itemsum['jili1_all']),
					),
				)),
	);
	$iswechat=pdo_getcolumn('core_account_wechat',array('uniacid'=>$_SESSION['uniacid']),'id');
	$site=pdo_get('core_accounts',array('uniacid'=>$_SESSION['uniacid']),array('title','logo','desc','ewm','credit2','groupid'));
	if($_SESSION['os']=='windows' && (empty($setting['share_title']) || empty($setting['hdps']))){
		if(empty($site['title']) || empty($site['desc'])){
			$htmls[]=array('type'=>'intro','title'=>'新手引导','datas'=>array(
				array('element'=>'#gowelcome','intro'=>'主人您好！您还没有设置好站点信息噢！</br>只有设置好了信息，才能有好的体验！点这里开始噢！</br>点这里-》返回系统-》站点设置','position'=>'bottom-middle-aligned'),
			));
		}elseif(empty($iswechat)){
			$htmls[]=array('type'=>'intro','title'=>'新手引导','datas'=>array(
				array('element'=>'#gowelcome','intro'=>'主人您好！您还没有添加默认公众号噢！</br>添加了默认有效的公众号，才能实现扫码登录，粉丝同步，微信支付等体验！</br>点这里-》返回系统-》应用端-》公众号管理','position'=>'bottom-middle-aligned'),
			));
		}
	}
	$return['htmls']=$htmls;
	exi($return);
}